<template>
  <h2>总价 - {{ $store.getters.totalPrice }}</h2>
  <h2>折扣比例 - {{ $store.getters.currentDiscount }}</h2>
  <h2>数量大于 n 的总价 - {{ $store.getters.totalPriceCountGreaterN(1) }}</h2>
  <h2>Page - {{ nameInfo }}</h2>
  <h2>Page - {{ ageInfo }}</h2>
</template>

<script>
import { mapGetters } from 'vuex'
import { useGetters } from '../hooks/useGetters'

export default {
  computed: {
    // ...mapGetters(['nameInfo', 'ageInfo']),
    // ...mapGetters({
    //   sNameInfo: 'nameInfo',
    //   sAgeInfo: 'ageInfo'
    // })
  },
  setup() {
    const storeGetters = useGetters(['nameInfo', 'ageInfo'])
    return {
      ...storeGetters
    }
  }
}
</script>

<style scoped></style>
